<!doctype html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>系统</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/common.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/member.css"/>
    <script type="text/javascript" src="../../script/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../../script/mobile.js"></script>
    <script type="text/javascript">
        window['adaptive'].desinWidth = 750;
        window['adaptive'].baseFont = 28;
        window['adaptive'].maxWidth = 750;
        window['adaptive'].init();
    </script>
</head>

<body>
<div id="header" style="height: 0.9rem; background: #fff; position: fixed; top: 0;left: 0; width: 100%; z-index: 99">
    <header class="header header-shadow">
        <div class="header-left">
            <div tapmode onclick="comeBack();" class="nav-left"><img class="icon-back" src="../../icon/icon-back.png"/>
            </div>
        </div>
        <h2>系统通知</h2>
        <div class="header-right">
            <div class="nav-right c-999"><img style="width: .3rem" src="../../icon/icon-clear2.png"/></div>
        </div>
    </header>
</div>
<div class="mescroll" id="mescroll" style="padding-top: 1.5rem">
    <section class="html_section  pl30 pr30">
        <ul class="msg_xt">

        </ul>
    </section>
</div>

</body>

</html>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<link rel="stylesheet" type="text/css" href="../../css/mescroll.min.css"/>
<script type="text/javascript" src="../../script/mescroll.min.js"></script>

<script type="text/javascript">
    apiready = function () {
        setFixStatusBar(); //设置状态栏
        pop.loading();
        keybackListener()
        ready();
    }
    //创建MeScroll对象
    var mescroll = new MeScroll("mescroll", {
        down: {
            auto: false, //是否在初始化完毕之后自动执行下拉回调callback; 默认true
            callback: downCallback //下拉刷新的回调
        }
    });
    /*下拉刷新的回调 */
    function downCallback() {
        ready()

        //mescroll.endErr();
    }

    function ready() {

        getAjax(Interface.get_notice_details, {token: $api.getStorage('token'), type: 2}, function (res) {
            pop.close();
            var html = '';
            if(isDefine(res.data)){
                $.each(res.data, function (j, jtem) {
                    $.each(jtem.data, function (i, item) {
                        html += '<li class="pt25 pb25 c-999 f24 t-c">' + jtem.date_time + ' ' + item.date_time + '</li>';
                        html += '<li class="msg_tz_li">';
                        html += '<div class="msg_title_img bg-cover" style="background-image: url(../../icon/xt.png);" ></div>';
                        html += '<div class="tz_content ">';
                        html += '<div class="system_box f24 c-999">' + item.content + '</div>';
                        html += '</div>';
                        html += '</li>';
                    })
                })
                $(".msg_xt").html(html);
            }else {
                $(".msg_xt").html(noData);
            }

            api.sendEvent({
                name: 'xtInfo',
                extra: {}
            });
            api.sendEvent({
                name: 'msgStatus',
                extra: {}
            });
            mescroll.endErr()
        }, function (res, err) {
            mescroll.endErr()
        })
    }

    $(".nav-right").click(function () {
        confirmBox('清空系统通知', '您确认要清空吗', function () {
            pop.loading();
            getAjax(Interface.notice_del, {token: $api.getStorage('token'), type: 2}, function (res) {
                pop.close();
                pop.notice('清除成功!');
                api.sendEvent({
                    name: 'reload',
                    extra: {}
                });
                ready();
            }, function (res, err) {
            })
        })
    })


</script>
